#ifndef _PANDAX_TYPE_H__
#define _PANDAX_TYPE_H__

typedef float PXFLOAT;
typedef int PXINT32;
typedef unsigned int PXUINT32;
typedef short PXINT16;
typedef unsigned  short PXUINT16;
typedef char PXINT8;
typedef unsigned char PXUINT8;
typedef unsigned int size_t;
typedef char PXBOOL;
#define  PXTURE 1
#define  PXFALSE 0
#define  NULL 0
typedef float GLfloat;
typedef unsigned char GLubyte;
typedef unsigned int GLenum;
typedef struct _rect
{
	PXFLOAT x;
	PXFLOAT y;
	PXFLOAT width;
	PXFLOAT height;
}PXRECT;

typedef struct _point
{
	PXFLOAT x;
	PXFLOAT y;
}PXPOINT;
typedef struct _size
{
	PXFLOAT width;
	PXFLOAT height;
}PXSIZE;

typedef struct pxTex2F {
	GLfloat u;
	GLfloat v;
} PXTex2F;

typedef struct pxVertex3F
{
	GLfloat x;
	GLfloat y;
	GLfloat z;
} PXVertex3F;

typedef struct pxColor3B
{
	GLubyte	r;
	GLubyte	g;
	GLubyte b;
} PXColor3B;

typedef struct pxColor4B
{
	GLubyte r;
	GLubyte g;
	GLubyte b;
	GLubyte a;
} PXColor4B;

typedef struct pxColor4F {
	GLfloat r;
	GLfloat g;
	GLfloat b;
	GLfloat a;
} PXColor4F;

typedef struct pxVertex2F
{
	GLfloat x;
	GLfloat y;
} PXVertex2F;
//! a Point with a vertex point, a tex coord point and a color 4B
typedef struct pxV2F_C4B_T2F
{
	//! vertices (2F)
	PXVertex2F		vertices;
	//! colors (4B)
	PXColor4B		colors;
	//! tex coords (2F)
	PXTex2F			texCoords;
} PXV2F_C4B_T2F;

//! a Point with a vertex point, a tex coord point and a color 4F
typedef struct pxV2F_C4F_T2F
{
	//! vertices (2F)
	PXVertex2F		vertices;
	//! colors (4F)
	PXColor4F		colors;
	//! tex coords (2F)
	PXTex2F			texCoords;
} PXV2F_C4F_T2F;

//! a Point with a vertex point, a tex coord point and a color 4B
typedef struct pxV3F_C4B_T2F
{
	//! vertices (3F)
	PXVertex3F		vertices;			// 12 bytes
	//	char __padding__[4];

	//! colors (4B)
	PXColor4B		colors;				// 4 bytes
	//	char __padding2__[4];

	// tex coords (2F)
	PXTex2F			texCoords;			// 8 byts
} PXV3F_C4B_T2F;


typedef struct pxV2F_C4B_T2F_Quad
{
	//! bottom left
	PXV2F_C4B_T2F	bl;
	//! bottom right
	PXV2F_C4B_T2F	br;
	//! top left
	PXV2F_C4B_T2F	tl;
	//! top right
	PXV2F_C4B_T2F	tr;
} PXV2F_C4B_T2F_Quad;

typedef struct pxV3F_C4B_T2F_Quad
{
	//! top left
	PXV3F_C4B_T2F	tl;
	//! bottom left
	PXV3F_C4B_T2F	bl;
	//! top right
	PXV3F_C4B_T2F	tr;
	//! bottom right
	PXV3F_C4B_T2F	br;
} PXV3F_C4B_T2F_Quad;


typedef struct pxV2F_C4F_T2F_Quad
{
	//! bottom left
	PXV2F_C4F_T2F	bl;
	//! bottom right
	PXV2F_C4F_T2F	br;
	//! top left
	PXV2F_C4F_T2F	tl;
	//! top right
	PXV2F_C4F_T2F	tr;
} PXV2F_C4F_T2F_Quad;

//! Blend Function used for textures
typedef struct pxBlendFunc
{
	//! source blend function
	GLenum src;
	//! destination blend function
	GLenum dst;
} PXBlendFunc;
static  PXVertex3F vertex3(const float x, const float y, const float z)
{
	PXVertex3F c = {x, y, z};
	return c;
}

static  PXTex2F tex2(const float u, const float v)
{
	PXTex2F t = {u , v};
	return t;
}


#endif // px_type_h__
